
package com.google.code.sms.android.service;

import java.util.List;

import org.apache.http.HttpResponse;

import com.google.code.sms.android.domain.Indexes;
import com.google.code.sms.android.domain.MediaElement;
import com.google.code.sms.android.domain.MediaFolder;
import com.google.code.sms.android.domain.Playlist;
import com.google.code.sms.android.domain.SearchCritera;
import com.google.code.sms.android.domain.SearchResult;
import com.google.code.sms.android.domain.Version;
import com.google.code.sms.android.util.CancellableTask;
import com.google.code.sms.android.util.ProgressListener;

import android.content.Context;
import android.graphics.Bitmap;

/**
 * @author Sindre Mehus
 */
public interface MusicService {

    void ping(Context context, ProgressListener progressListener) throws Exception;

    List<MediaFolder> getMediaFolders(boolean refresh, Context context, ProgressListener progressListener) throws Exception;

    Indexes getIndexes(String mediaFolderId, boolean refresh, Context context, ProgressListener progressListener) throws Exception;

    MediaElement getMediaDirectory(String id, boolean refresh, Context context, ProgressListener progressListener) throws Exception;

    SearchResult search(SearchCritera criteria, Context context, ProgressListener progressListener) throws Exception;

    MediaElement getPlaylist(String id, Context context, ProgressListener progressListener) throws Exception;

    List<Playlist> getPlaylists(boolean refresh, Context context, ProgressListener progressListener) throws Exception;

    void createPlaylist(String id, String name, List<MediaElement.Entry> entries, Context context, ProgressListener progressListener) throws Exception;

    MediaElement getAlbumList(String type, int size, int offset, Context context, ProgressListener progressListener) throws Exception;

    Bitmap getCoverArt(Context context, MediaElement.Entry entry, int size, boolean saveToFile, ProgressListener progressListener) throws Exception;

    HttpResponse getDownloadInputStream(Context context, MediaElement.Entry song, long offset, String audioQuality, CancellableTask task) throws Exception;

    Version getLocalVersion(Context context) throws Exception;

    String getVideoUrl(Context context, String id) throws Exception;
    
    String getSubtitlesUrl(Context context, String id) throws Exception;
}